package reduce.fz.com.reduce.activity;

import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.bean.User;
import reduce.fz.com.reduce.fragment.AttentionListFragment;
import reduce.fz.com.reduce.service.preference.UserPreference;

public abstract class BaseFragmentActivity extends BaseToolBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base_fragment);
    }

    @Override
    protected void onStart() {
        super.onStart();
        attachFragment();
    }

    public void attachFragment() {
        Fragment fragment = getFragment();
        getSupportFragmentManager().beginTransaction().replace(R.id.main_container, fragment).commit();
    }

    public abstract Fragment getFragment();


}
